package com.krlin.soccer.soccer.controller;

import com.krlin.soccer.soccer.entity.User;
import com.krlin.soccer.soccer.tools.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LoginController {

    @PostMapping("/login")
    public Result login(@RequestBody User user) {
        log.info(user.getUsername()+"  "+user.getPassword());
        if ("admin".equals(user.getUsername()) && "123456".equals(user.getPassword())) {
            return Result.succ("登陆成功");
        } else {
            return Result.fail("登陆失败");
        }
    }

}
